/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package reciprocal;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author Eagle
 */
public class myFile {
    static void saveFile(int[][] buf, String title)
        {

        //Init a stream
        BufferedWriter fo=null;

        try
            {
                fo=new BufferedWriter(new FileWriter("save.csv",true));
                fo.write(title);
                for (int i=0;i<buf.length;i++)
                {
                    String s="";
                    for (int j=0;j<4;j++)
                    {
                        s=s+Integer.toString(buf[i][j])+",";
                    }
                    s=s+Integer.toString(buf[i][4]);

                    s=s+"\n";
                    fo.write(s);
                }

                fo.close();
            } catch (IOException e) {

            }

        }

}
